<template>
  <div class="outline-parent">
    <div class="flex-box border-hover-style">
      <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
      </t-image-viewer>
      <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
      </van-image-preview>
      <t-popup
        class="placement bottom center"
        attach="#attach"
        content="查看本单元全景展厅"
        placement="bottom"
        showArrow
        destroyOnClose
        :disabled="store.isMobileType ? true : false"
        v-if="props.info.digitalShowroom"
      >
        <img
          class="icon-3d blinking-animation-style"
          id="outlineIcon"
          @click="open(props.info.digitalShowroom)"
          :src="publicUrls + 'free/style4/3dIcon.webp'"
        />
      </t-popup>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style4/Level3outlineStyle1Bg.webp'" alt="" />
      <div class="outline">
        <div class="outline-content">
          <div class="outline-title">
            {{ props.info.text }}
          </div>
          <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <img
            class="outline-cover"
            v-if="props.info.value"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/w/898/h/460/format/webp'"
            alt=""
          />
          <TextMax
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :infoData="props.info"
            :row="props.info.value ? 5 : 10"
          ></TextMax>
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style4/firstLevelOutline3Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free4Style1',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
  .shadow {
    width: 620px;
    height: 220px;
    position: absolute;
    bottom: 0;
    left: 0;
  }
}
.icon-3d {
  width: 37px;
  height: 47px;
  object-fit: contain;
  position: absolute;
  top: 5px;
  right: 60px;
  z-index: 21;
}
.flex-box {
  width: 486px;
  height: 684px;
  display: flex;
  flex-direction: column;
  justify-content: start;
  position: relative;
  padding: 107px 70px 103px 70px;
  z-index: 20;
  overflow: hidden;
}

.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  z-index: 22;
}
.outline-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.outline-title {
  width: 100%;
  color: #5391a3;
  text-align: center;
  font-family: 'SourceHanSerifCN-Bold';
  font-size: 20px;
  line-height: 30px;
  margin-bottom: 16px;
}
.outline-subTitle {
  width: 100%;
  font-family: SourceHanSerifCN;
  color: #333;
  text-align: center;
  font-size: 16px;
  line-height: 28px;
  margin-bottom: 16px;
}
.outline-cover {
  width: 100%;
  height: 100%;
  flex: 1;
  object-fit: contain;
  margin-bottom: 16px;
  overflow: hidden;
  background: #e1f2f2;
}
::v-deep .textMore-box {
  flex-shrink: 0;
}
::v-deep .van-text-ellipsis {
  color: #333;
  text-align: justify;
  font-family: 'PingFangSC';
  font-size: 16px;
  line-height: 32px;
}
::v-deep .van-text-ellipsis__action::before {
  color: #83b0b3 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
::v-deep .t-popup__content {
  background: #bcd5d5;
  box-shadow: none;
  padding: 0 10px;
  line-height: 20px;
  color: #fcffff;
}
::v-deep .t-popup__arrow::before {
  background: #bcd5d5;
  border: none;
  box-shadow: none !important;
}
</style>